#pragma once
#include "common_data.h"
#include <QObject>

struct AlgInit {
	Position base;	// 基准坐标
	Size rang;		// 物料的放置范围
};


struct AlgSkuInfo {
	Size size;
	int stackType;	// 0:表示任意
};

class Algorithm {

public:
	/*算法初始化接口*/
	virtual bool Init(const AlgInit& init, const QString& other) = 0;

	virtual bool InitSkuInfo(const AlgSkuInfo& sku, QString& result) = 0;

	virtual bool Calculate(const QString& input, Position& pos, QString& output) = 0;
	virtual bool ExcuteCmd(int cmd, const QString& input, QString& output) = 0;
};

#define Algorithm_IID "com.bluesword.Algorithm"

class AlgorithmPlugin
{
public:
	AlgorithmPlugin() {}
	virtual ~AlgorithmPlugin() {}

	virtual Algorithm* CreateAlgorithmObject() = 0;
};

Q_DECLARE_INTERFACE(AlgorithmPlugin, Algorithm_IID)
